package com.px.dal;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import com.px.idal.ICompanyUsersMapper;
import com.px.model.CompanyUsers;
import com.px.mybatisunit.MyBatisUtil;

public class CompanyUsersMapper {
	// 创建SqlSession对象的实例
		SqlSession session = MyBatisUtil.getsqlSession(true);
		// IUserInfoMapper接口通过sqlsession的getmap方法,完成实现,全部自动化
		ICompanyUsersMapper mapper = session.getMapper(ICompanyUsersMapper.class);

		 // 单位负责人登录方法
		public CompanyUsers validateCompanyUsersLogin(CompanyUsers companyusers) {
			return mapper.validateCompanyUsersLogin(companyusers);
		}
		// 查询单位所有负责人
		public List<CompanyUsers> getAllCompanyUsers() {
			return mapper.getAllCompanyUsers();
		}
		// 查询指定id单位负责人
		public List<CompanyUsers> getCompanyUsersByCompanyUsersId(CompanyUsers companyusers) {
			return mapper.getCompanyUsersByCompanyUsersId(companyusers);
		}
		// 增加单位负责人
		public int insertCompanyUsers(CompanyUsers companyusers) {
			return mapper.insertCompanyUsers(companyusers);
		}
		// 更新指定user_id的单位负责人的密码为user_pass
		public int updateCompanyUsersByCompanyUsersId(CompanyUsers companyusers) {
			return mapper.updateCompanyUsersByCompanyUsersId(companyusers);
		}
		// 删除指定user_id的单位负责人
		public int deleteCompanyUsersBCompanyUsersId(CompanyUsers companyusers) {
			return mapper.deleteCompanyUsersBCompanyUsersId(companyusers);
		}
		// 查询单位负责人信息总条数
		public int getAllCompanyUsersCounts() {
			return mapper.getAllCompanyUsersCounts();
		}
		// 查询指定Id单位负责人是否存在
		public int checkCompanyUsersIdIsExist(CompanyUsers companyusers) {
			return mapper.checkCompanyUsersIdIsExist(companyusers);
		}




}
